eratic / sites / io / src / pages / [...slug].astro
103 words
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
import { render } from 'astro:content';
import Entry from '@eratic/core/layouts/Entry.astro';
import { mdxComponents } from '@eratic/core/components/mdx';
import LinkList from '../components/LinkList.astro';
import { allIssues, issuePath, issueTitle, groupLinks } from '../lib/entries';

export async function getStaticPaths() {
	const issues = await allIssues();
	return issues.map((entry) => ({
		params: { slug: entry.id },
		props: { entry },
	}));
}

const { entry } = Astro.props;
const { Content } = await render(entry);
const groups = groupLinks(entry);
const count = entry.data.links.length;
---

<Entry
	site="io"
	title={issueTitle(entry)}
	summary={entry.data.summary}
	path={issuePath(entry)}
	pubDate={entry.data.pubDate}
	updatedDate={entry.data.updatedDate}
	tags={entry.data.tags}
	canvas={entry.data.canvas}
	theme={entry.data.theme}
	kicker={`${count} thing${count === 1 ? '' : 's'}`}
>
	<Content components={mdxComponents} />
	<LinkList groups={groups} />
</Entry>

static mirror of HEAD · about · clone: git clone https://git.makefuture.ro/eratic.git